package com.example.demo.pojos;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Date;
import java.util.List;
import java.util.Objects;

@Entity
public class Xsjhinfo {
    private int xsjhId;
    private String jhzt;
    private Date gxDate;
    private String xsjhzt;
    private Date fxdate;
    private String xsjhly;
    private String khxq;
    private Date yjqddate;
    private BigDecimal knx;
    private BigDecimal yqje;
    private String xb;
    private String yxj;
    private String xsjhjd;
    private Integer jdtl;
    private String gzrz;
    private String jdbz;
    private Client kh;
    private Contact khlxr;
    private Zdyxxinfo zdyxx;
    private Xsjhlxinfo xsjhlx;
    private User fzr;
    private User tgr;
    private Khxqinfo khxq1;
    private List<Jjfainfo> jjfa;
    private List<Jzgxinfo> jzgx;
    private List<Bjinfo> bj;
    private Order htdd;

    @Id
    @Column(name = "xsjhId", nullable = false)
    public int getXsjhId() {
        return xsjhId;
    }

    public void setXsjhId(int xsjhId) {
        this.xsjhId = xsjhId;
    }

    @Basic
    @Column(name = "jhzt", nullable = true, length = 20)
    public String getJhzt() {
        return jhzt;
    }

    public void setJhzt(String jhzt) {
        this.jhzt = jhzt;
    }

    @Basic
    @Column(name = "gxDate", nullable = true)
    public Date getGxDate() {
        return gxDate;
    }

    public void setGxDate(Date gxDate) {
        this.gxDate = gxDate;
    }

    @Basic
    @Column(name = "xsjhzt", nullable = true, length = 10)
    public String getXsjhzt() {
        return xsjhzt;
    }

    public void setXsjhzt(String xsjhzt) {
        this.xsjhzt = xsjhzt;
    }

    @Basic
    @Column(name = "fxdate", nullable = true)
    public Date getFxdate() {
        return fxdate;
    }

    public void setFxdate(Date fxdate) {
        this.fxdate = fxdate;
    }

    @Basic
    @Column(name = "xsjhly", nullable = true, length = 20)
    public String getXsjhly() {
        return xsjhly;
    }

    public void setXsjhly(String xsjhly) {
        this.xsjhly = xsjhly;
    }

    @Basic
    @Column(name = "khxq", nullable = true, length = 50)
    public String getKhxq() {
        return khxq;
    }

    public void setKhxq(String khxq) {
        this.khxq = khxq;
    }

    @Basic
    @Column(name = "yjqddate", nullable = true)
    public Date getYjqddate() {
        return yjqddate;
    }

    public void setYjqddate(Date yjqddate) {
        this.yjqddate = yjqddate;
    }

    @Basic
    @Column(name = "knx", nullable = true, precision = 2)
    public BigDecimal getKnx() {
        return knx;
    }

    public void setKnx(BigDecimal knx) {
        this.knx = knx;
    }

    @Basic
    @Column(name = "yqje", nullable = true, precision = 2)
    public BigDecimal getYqje() {
        return yqje;
    }

    public void setYqje(BigDecimal yqje) {
        this.yqje = yqje;
    }

    @Basic
    @Column(name = "xb", nullable = true, length = 20)
    public String getXb() {
        return xb;
    }

    public void setXb(String xb) {
        this.xb = xb;
    }

    @Basic
    @Column(name = "yxj", nullable = true, length = 4)
    public String getYxj() {
        return yxj;
    }

    public void setYxj(String yxj) {
        this.yxj = yxj;
    }

    @Basic
    @Column(name = "xsjhjd", nullable = true, length = 20)
    public String getXsjhjd() {
        return xsjhjd;
    }

    public void setXsjhjd(String xsjhjd) {
        this.xsjhjd = xsjhjd;
    }

    @Basic
    @Column(name = "jdtl", nullable = true)
    public Integer getJdtl() {
        return jdtl;
    }

    public void setJdtl(Integer jdtl) {
        this.jdtl = jdtl;
    }

    @Basic
    @Column(name = "gzrz", nullable = true, length = 50)
    public String getGzrz() {
        return gzrz;
    }

    public void setGzrz(String gzrz) {
        this.gzrz = gzrz;
    }

    @Basic
    @Column(name = "jdbz", nullable = true, length = 50)
    public String getJdbz() {
        return jdbz;
    }

    public void setJdbz(String jdbz) {
        this.jdbz = jdbz;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Xsjhinfo xsjhinfo = (Xsjhinfo) o;
        return xsjhId == xsjhinfo.xsjhId &&
                Objects.equals(jhzt, xsjhinfo.jhzt) &&
                Objects.equals(gxDate, xsjhinfo.gxDate) &&
                Objects.equals(xsjhzt, xsjhinfo.xsjhzt) &&
                Objects.equals(fxdate, xsjhinfo.fxdate) &&
                Objects.equals(xsjhly, xsjhinfo.xsjhly) &&
                Objects.equals(khxq, xsjhinfo.khxq) &&
                Objects.equals(yjqddate, xsjhinfo.yjqddate) &&
                Objects.equals(knx, xsjhinfo.knx) &&
                Objects.equals(yqje, xsjhinfo.yqje) &&
                Objects.equals(xb, xsjhinfo.xb) &&
                Objects.equals(yxj, xsjhinfo.yxj) &&
                Objects.equals(xsjhjd, xsjhinfo.xsjhjd) &&
                Objects.equals(jdtl, xsjhinfo.jdtl) &&
                Objects.equals(gzrz, xsjhinfo.gzrz) &&
                Objects.equals(jdbz, xsjhinfo.jdbz);
    }

    @Override
    public int hashCode() {
        return Objects.hash(xsjhId, jhzt, gxDate, xsjhzt, fxdate, xsjhly, khxq, yjqddate, knx, yqje, xb, yxj, xsjhjd, jdtl, gzrz, jdbz);
    }

    @ManyToOne
    @JoinColumn(name = "khId", referencedColumnName = "client_id")
    public Client getKh() {
        return kh;
    }

    public void setKh(Client kh) {
        this.kh = kh;
    }

    @ManyToOne
    @JoinColumn(name = "khlxrId", referencedColumnName = "contact_id")
    public Contact getKhlxr() {
        return khlxr;
    }

    public void setKhlxr(Contact khlxr) {
        this.khlxr = khlxr;
    }

    @OneToOne
    @JoinColumn(name = "xsjhId", referencedColumnName = "xsjhId", nullable = false)
    public Zdyxxinfo getZdyxx() {
        return zdyxx;
    }

    public void setZdyxx(Zdyxxinfo zdyxx) {
        this.zdyxx = zdyxx;
    }

    @ManyToOne
    @JoinColumn(name = "xsjhlxId", referencedColumnName = "xsjhlxId")
    public Xsjhlxinfo getXsjhlx() {
        return xsjhlx;
    }

    public void setXsjhlx(Xsjhlxinfo xsjhlx) {
        this.xsjhlx = xsjhlx;
    }

    @ManyToOne
    @JoinColumn(name = "fzrId", referencedColumnName = "uid")
    public User getFzr() {
        return fzr;
    }

    public void setFzr(User fzr) {
        this.fzr = fzr;
    }

    @ManyToOne
    @JoinColumn(name = "tgrId", referencedColumnName = "uid")
    public User getTgr() {
        return tgr;
    }

    public void setTgr(User tgr) {
        this.tgr = tgr;
    }

    @OneToOne(mappedBy = "xsjh")
    public Khxqinfo getKhxq1() {
        return khxq1;
    }

    public void setKhxq1(Khxqinfo khxq1) {
        this.khxq1 = khxq1;
    }

    @OneToMany(mappedBy = "xsjh")
    public List<Jjfainfo> getJjfa() {
        return jjfa;
    }

    public void setJjfa(List<Jjfainfo> jjfa) {
        this.jjfa = jjfa;
    }

    @OneToMany(mappedBy = "xsjh")
    public List<Jzgxinfo> getJzgx() {
        return jzgx;
    }

    public void setJzgx(List<Jzgxinfo> jzgx) {
        this.jzgx = jzgx;
    }

    @OneToMany(mappedBy = "xsjh")
    public List<Bjinfo> getBj() {
        return bj;
    }

    public void setBj(List<Bjinfo> bj) {
        this.bj = bj;
    }

    @OneToOne(mappedBy = "xsjh")
    public Order getHtdd() {
        return htdd;
    }

    public void setHtdd(Order htdd) {
        this.htdd = htdd;
    }
}
